<div class="box box-maxbid">
	<div class="box-header">
		<h3 class="box-title">Leil&otilde;es Cadastro</h3>
	</div>
	<!-- /.box-header -->
	<!-- form start -->

	<div class="overlay" ng-show="hideform"></div>
	<div class="loading-img" ng-show="hideform"></div>

	<form role="form" name="LeilaoForm">
		<div class="box-body">
			<div class="form-group row">
				<div ng-show="encerrado" class="col-md-4 col-xs-6">
				  <br/>
					<div class="box box-solid bg-red">
						<div class="box-header">
							<h3 class="box-title">LEILÃO ENCERRADO</h3>
						</div>

					</div>
				</div>
				<div ng-hide="encerrado" class="col-md-2 col-xs-3">
					<br /> <label for="InputStatus"><input type="radio"
						ng-model="leilao.STATUS" name="STATUS" value="3" checked="checked" />
						Loteamento </label>
				</div>
				<div ng-hide="encerrado" class="col-md-2 col-xs-3">
					<br /> <label for="InputStatus"><input type="radio"
						ng-model="leilao.STATUS" name="STATUS" value="2" /> Lance </label>
				</div>

				<div class="col-md-4 col-xs-6">
					<label for="InputContrato"> Condi&ccedil;&atilde;o
						Habilita&ccedil;&atilde;o </label> 
                    <select name="CONDICAO_VENDA_ID"
                        required 
                        ng-model="leilao.CONDICAO_VENDA_ID" class="form-control" 
						ng-disabled="encerrado" 
                        ng-options="cond.ID as cond.TITLE for cond in condicoes" 
                       	>
						<option value="">Selecione</option>
						



					</select>
				</div>
				<div class="col-md-2 col-xs-6">
					<label for="exampleInputEmail1">Data</label> <input type="text"
						class="form-control" id="InputDate" required name="DATA"
						ng-model="leilao.DATA" format="99/99/9999" coc-mask
						ng-disabled="encerrado" />



				</div>
				<div class="col-md-2 col-xs-6">
					<label for="exampleInputEmail1">Hora</label> <input type="text"
						class="form-control" id="InputHora" name="HORA"
						ng-model="leilao.HORA" required ui-mask="99:99" maxlength="5" ng-disabled="encerrado">
					<div class="messages-alert"
						ng-show="LeilaoForm.HORA.$dirty && LeilaoForm.HORA.$invalid" ng-disabled="encerrado">
						<span ng-show="LeilaoForm.HORA.$error.required">* Campo &eacute;
							obrigat&oacute;rio</span>

					</div>
				</div>


			</div>


			<div class="form-group row">
				<div class="col-md-4">
					<label for="InputLogin">Comitente </label> <select ng-disabled="encerrado"
						ng-model="leilao.COMITENTE_ID" class="form-control" required
						name="COMITENTE_ID"
						ng-options="comitente.ID as comitente.RAZAO for comitente in comitentes">
						<option value="">Comitente</option>
					</select>
					<div class="messages-alert"
						ng-show="LeilaoForm.COMITENTE_ID.$dirty && LeilaoForm.COMITENTE_ID.$invalid">
						<span ng-show="LeilaoForm.COMITENTE_ID.$error.required">* Campo
							&eacute; obrigat&oacute;rio</span>
					</div>
				</div>
				<div class="col-md-5">
					<label for="exampleInputEmail1">Descri&ccedil;&atilde;o do
						Leil&atilde;o</label> <input type="text" name="TITLE"
						ng-model="leilao.TITLE" required class="form-control"
						id="exampleInputEmail1" placeholder="Dados" ng-disabled="encerrado">
				</div>
				<div class="col-md-3">
					<label for="InputTipo">Tipo de Leil&atilde;o </label> <select ng-disabled="encerrado"
						class="form-control"  required ng-model="leilao.TIPO"
						ng-selected="leilao.TIPO" name="TIPO">
						<option value="">Tipo do Leil&atilde;o</option>
						<option ng-repeat="type in tipos" value="{{type.id}}">{{type.label}}</option>

					</select>
					<div class="messages-alert"
						ng-show="LeilaoForm.TIPO.$dirty && LeilaoForm.TIPO.$invalid">
						<span ng-show="LeilaoForm.TIPO.$error.required">* Selecione uma
							op&ccedil;&atilde;o</span>
					</div>
				</div>
			</div>
                    <div class="form-group row">
                        <div class="col-xs-12">
                            <label for="">SUBDESCRIÇÃO</label>
                            <input type="text" name="DESCRICAO" 
                                   ng-model="leilao.DESCRICAO" required class="form-control"
						id="exampleInputEmail1" placeholder="Subdescrição" ng-disabled="encerrado">
                            
                        </div>
                        
                    </div>
                    <div class="row">
                        <div class="col-xs-4 form-group">
                        <label>PAGAMENTO EM CONTA DO LEILOEIRO</label>
                           <select name="LEILOEIRO_ID" class="form-control" ng-model="leilao.LEILOEIRO_ID" ng-options="lc.ID as lc.NOME for lc in leiloeiros">
                             <option value="">--LEILOEIRO--</option>
                           </select> 
                           <div style="font-size: .8em; margin-top:15px;" class="label label-danger">Selecione um leiloeiro quando o pagamento for na conta do leiloeiro</div>   
                        </div>
                        <div class="col-xs-8 form-group">
                         <label>&nbsp;</label>
                        
                        </div>
                        </div>
                    


			<div class="form-group row" ng-show="edition">
				<div class="col-xs-12">
					<h4 style="margin-top: 0px; margin-bottom: 5px;">Informa&ccedil;&otilde;es</h4>
					<hr style="margin-top: 0px;" />

				</div>

				<div class="col-lg-2 col-xs-6" ng-show="files[0].name">


					<!-- small box -->
					<div class="small-box bg-gray image-leilao">
						<div class="inner box-inner-image-leilao">
							<input type="hidden" name="IMAGEM" value="{{files[0].name}}" /> <img
								class=""
								ng-src="<?php echo web_dir(); ?>images/leiloes/{{files[0].name}}"
								width="82%" /> <a href="javascript:void(0)"
								title="remover imagem"
								class="btn delete-image-leilao btn-danger btn-sm"
								ng-click="onDeleteImage(files[0].name)"><i class="fa fa-trash-o"></i></a>

						</div>


					</div>
				</div>
				<div class="col-lg-2 col-xs-6">


					<!-- small box -->
					<div class="small-box bg-blue">
						<div class="inner">
							<h3>{{leilao.INFO.NUM_LOTES}}</h3>
							<p>Lotes Cadastrados</p>
						</div>
						<div class="icon">
							<i class="fa fa-legal"></i>
						</div>
						<a href="#/leilao/{{key}}/lotes" class="small-box-footer">
							Visualizar Lotes <i class="fa fa-arrow-circle-right"></i>
						</a>
					</div>
				</div>

				<div class="col-lg-2 col-xs-6">
					<!-- small box -->
					<div class="small-box bg-green">
						<div class="inner">
							<h3>{{leilao.INFO.HABILITADOS}}</h3>
							<p>Habilitados</p>
						</div>
						<div class="icon">
							<i class="ion ion-person"></i>
						</div>
						<a href="#" coc-click-prevent ng-click="onShowUserEnableds(leilao)" class="small-box-footer"> Visualizar <i
							class="fa fa-arrow-circle-right"></i>
						</a>
					</div>
				</div>
			</div>
		</div>
		<!-- /.box-body -->

		<div class="box-footer">
			<button ng-hide="encerrado" type="submit"  ng-click="save()"
				ng-disabled="LeilaoForm.$invalid" class="btn btn-primary">Salvar</button>
			<button ng-hide="encerrado" type="submit" ng-click="save('/leilao/')"
				ng-disabled="LeilaoForm.$invalid" class="btn btn-primary">Salvar e
				Listar</button>
			<a href="#/leilao" class="btn btn-danger">Listar</a> <span
				class="separator"></span> 
				<a href="javascript:void(0)" ng-hide="encerrado"
				ng-disabled="LeilaoForm.$invalid" ng-click="triggerButton()"
				class="btn btn-info"><i class="fa fa-picture-o"></i> Upload Imagem</a>
			<div class="row">
				<div ng-show="startProgressBar" class="col-xs-12"
					style="margin-top: 10px;">
					<div class="progress xs leilao-progress-bar">
						<div class="progress-bar progress-bar-light-blue"
							style="width: {{progress"></div>
					</div>
				</div>
				<div ng-hide="encerrado">
				<upload-button action="/api/uploadFileByLeilao"
					complete="uploaded($data, $status)" ></upload-button>
					</div>
			</div>
		</div>
	</form>
</div>
<!-- /.box -->

